package com.memoir.exception;

import com.memoir.model.enums.ResponseConstantEnums;

public class BusinessException  extends RuntimeException {
    /**
     * 错误码
     */
    private final String code;

    public BusinessException(String code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ResponseConstantEnums enums) {
        super(enums.getMsg());
        this.code = enums.getCode();
    }


    public String getCode() {
        return code;
    }
}
